{% extends 'student_management/base.html' %}

{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
    <h2>教师列表</h2>
    <a href="{% url 'teacher-create' %}" class="btn btn-primary">添加教师</a>
</div>

<table class="table table-striped">
    <thead>
        <tr>
            <th>工号</th>
            <th>姓名</th>
            <th>性别</th>
            <th>职称</th>
            <th>院系</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        {% for teacher in teachers %}
        <tr>
            <td>{{ teacher.teacher_id }}</td>
            <td>{{ teacher.name }}</td>
            <td>{{ teacher.get_gender_display }}</td>
            <td>{{ teacher.title }}</td>
            <td>{{ teacher.department }}</td>
            <td>
                <a href="{% url 'teacher-ratings' teacher.pk %}" class="btn btn-sm btn-info">查看评价</a>
                <a href="{% url 'teacher-update' teacher.pk %}" class="btn btn-sm btn-warning">编辑</a>
                <a href="{% url 'teacher-delete' teacher.pk %}" class="btn btn-sm btn-danger">删除</a>
            </td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% endblock %} 